RAIS  3.2
C:/Projekte/RAIS/dataaccesslayer/SealedSourceData.cs
Go to the documentation of this file.
00001 using System;
00002 using System.Collections.Generic;
00003 using System.Text;
00004 using System.Data;
00005 using System.Data.SqlClient;
00006 
00007 namespace RAIS.DataAccessLayer
00008 {
00012     public class SealedSourceData : IDisposable
00013     {
00014         SqlConnection connection = new SqlConnection(DataAccessUtilities.ConnectionString);
00015         IDataReader reader;
00016         string commandText = "usp_GetSealedSource";
00017         SqlCommand sqlCommand = new SqlCommand();
00018         public IDataReader Reader
00019         {
00020             get { return reader; }
00021         }
00022         public SealedSourceData(int userID)
00023         {
00024             connection.Open();
00025             sqlCommand.Connection = connection;
00026             sqlCommand.CommandType = CommandType.StoredProcedure;
00027             sqlCommand.CommandText = commandText;
00028             SqlParameter userParameter = new SqlParameter("UserID", userID);
00029             sqlCommand.Parameters.Add(userParameter);
00030             reader = sqlCommand.ExecuteReader();
00031         }
00032         public void Dispose()
00033         {
00034             reader.Close();
00035             connection.Close();
00036         }
00037     }
00038 }